﻿<%@ Page Language="C#" MasterPageFile="~/admin/adminMasterPage.master" AutoEventWireup="true" CodeFile="dimnew.aspx.cs" Inherits="admin_product_dimnew" Title="无标题页" %>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
    
    <div class="table">
        <div class="tableHead">当前推荐产品</div>
         <asp:GridView ID="newProductGridView" runat="server" AutoGenerateColumns="False" 
            Width="100%" DataSourceID="ObjectDataSource1" onrowcommand="newProductGridView_RowCommand" 
            >
             <Columns>
                <asp:TemplateField HeaderText="编号" ItemStyle-Width="80px">
                    <ItemTemplate>
                        <asp:Label ID="Label1" Text="<%#Container.DataItemIndex + 1%>" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="productName_cn" HeaderText="产品名称" />
                <asp:BoundField DataField="categoryName_cn" HeaderText="所属类别"  ReadOnly="true"/>
                <asp:BoundField DataField="productDate" HeaderText="添加时间" ReadOnly="true" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" ItemStyle-Width="160px"/>
                <asp:TemplateField HeaderText="操作" ItemStyle-Width="80px">
                    <ItemTemplate>
                        <asp:Button ID="cancelButton" runat="server"
                            CommandName="cancelNew" 
                            CommandArgument='<%#Eval("productId") %>'
                            Text="取消最新"
                            CssClass="lbutton"
                            BorderColor="Transparent"
                            BorderStyle="None"
                           />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        SelectMethod="getNewProducts" TypeName="DB"></asp:ObjectDataSource>
    <div style="height:30px;">
    </div>
    <div class="table">
        <div class="tableHead">
        全部产品
            <div style="display:inline;float:right;line-height:35px;vertical-align:middle;padding-top:5px;padding-right:5px;">
                <asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True" 
                    AutoPostBack="True" DataSourceID="ObjectDataSource3" 
                    DataTextField="categoryName_cn" DataValueField="categoryId" 
                    onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                    <asp:ListItem Value="-1">全部类型</asp:ListItem>
    </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
                    SelectMethod="getSmallCategory" TypeName="DB"></asp:ObjectDataSource>
            </div>
        </div>
        <asp:GridView ID="allProductGridView" runat="server" 
            AutoGenerateColumns="False" Width="100%" DataSourceID="ObjectDataSource2" 
             onrowcommand="allProductGridView_RowCommand" >
            <Columns>
                <asp:TemplateField HeaderText="编号" ItemStyle-Width="80px">
                    <ItemTemplate>
                        <asp:Label ID="Label1" Text="<%#Container.DataItemIndex + 1%>" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="productName_cn" HeaderText="产品名称" />
                <asp:BoundField DataField="categoryName_cn" HeaderText="所属类别" />
                <asp:BoundField DataField="productDate" HeaderText="添加时间" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" ItemStyle-Width="160px"/>
                <asp:TemplateField HeaderText="操作" ItemStyle-Width="80px">
                    <ItemTemplate>
                        <asp:Button ID="cancelButton" runat="server"
                            CommandName="dimNew" 
                            CommandArgument='<%#Eval("productId") %>'
                            Text="置为最新"
                            CssClass="lbutton"
                            BorderColor="Transparent"
                            BorderStyle="None"
                           />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
        SelectMethod="getNotNewProducts" TypeName="DB">
    </asp:ObjectDataSource>
</asp:Content>

